<template>
  <div>另一个pinia的演示页面</div>
  <div>
    计数器的值：{{ count }}
    <button @click="increment">修改计数器的值</button>
    <button @click="toOther">跳转到另一个演示页面</button>
  </div>
</template>

<script lang="ts" setup>
import { useRouter } from 'vue-router'
import { storeToRefs } from 'pinia'
import store from '../../store/index'
// 获取pinia状态管理中的count值
const { count } = storeToRefs(store())
// 获取pinia状态管理中的increment方法
const { increment } = store()

const router = useRouter()

function toOther() {
  router.push('/study/pinia')
}
</script>

<style lang="scss" scoped></style>
